package com.heima.pojo;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConfig {


    /*
        @ConditionalOnProperty(name = "whatfa",havingValue = "wangdefa")
               根据配置文件中的值是否匹配决定是否创建
         name：key
         hvingvalue：value
    */
    @Bean
    @ConditionalOnProperty(name = "whatfa",havingValue = "wangdefa")
    public User user(){
        return new User();
    }

}
